load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "cert",
    srcs = [
        "certificate_authority.go",
        "util.go",
        "vault_certificate_authority.go",
    ],
    importpath = "go.f110.dev/heimdallr/pkg/cert",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/cert/vault",
        "//pkg/config/configv2",
        "//pkg/database",
        "//pkg/logger",
        "//vendor/golang.org/x/xerrors",
        "//vendor/software.sslmate.com/src/go-pkcs12",
    ],
)

go_test(
    name = "cert_test",
    srcs = [
        "certificate_authority_test.go",
        "util_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":cert"],
    deps = [
        "//pkg/config/configv2",
        "//pkg/database",
        "//pkg/database/memory",
        "//vendor/github.com/stretchr/testify/assert",
        "//vendor/github.com/stretchr/testify/require",
        "//vendor/software.sslmate.com/src/go-pkcs12",
    ],
)
